package com.cgwx.commonutils.math;

/**
 * @author GaoWei
 * @Date 2021/8/6 - 11:00
 */
public class PowNode extends OpNode
{
    public PowNode(Expression leftChild, Expression rightChild)
    {
        super(leftChild, rightChild);
    }

    public double eval(VarMap v, FuncMap f) {
        double a = this.leftChild.eval(v, f);
        double b = this.rightChild.eval(v, f);
        return Math.pow(a, b);
    }

    public String getSymbol()
    {
        return "^";
    }
}
